package com.fejal.bean;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.validator.Range;

@Entity

public class Horario implements Serializable {


	private static final long serialVersionUID = -3018967455131686276L;
	
	@Id
	@GeneratedValue (strategy = GenerationType.AUTO)
	private int codigoHorario;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "codigoTurmaOfertaDisciplina", insertable = true, updatable = true)
	@Fetch(FetchMode.JOIN)
	@Cascade(CascadeType.SAVE_UPDATE)
	private TurmaOfertaDisciplina turmaOfertaDisciplina;
	
	@Range(min=1, max=7)
	private int dia;
	
	@Range(min=1, max=7)
	private int aula;
	
	public Horario(){
		
	}

	public int getCodigoHorario() {
		return codigoHorario;
	}

	public void setCodigoHorario(int codigoHorario) {
		this.codigoHorario = codigoHorario;
	}

	public TurmaOfertaDisciplina getTurmaOfertaDisciplina() {
		return turmaOfertaDisciplina;
	}

	public void setTurmaOfertaDisciplina(TurmaOfertaDisciplina turmaOfertaDisciplina) {
		this.turmaOfertaDisciplina = turmaOfertaDisciplina;
	}

	public int getDia() {
		return dia;
	}

	public void setDia(int dia) {
		this.dia = dia;
	}

	public int getAula() {
		return aula;
	}

	public void setAula(int aula) {
		this.aula = aula;
	}
	
}
